<?php


namespace app\admin\validate;

use app\admin\model\OperateModel;
use think\Validate;

class OperateForm extends Validate
{
    protected $rule = [
        'name|运营中心名字' =>'require|max:200',
        'parent_id|上级运营中心' =>'require|number|max:11',
        'username|账号' =>'require|max:60',
        'password|密码' =>'require|max:128|/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z\\W]{6,18}$/',
    ];
    protected $message = [
        'password./^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z\\W]{6,18}$/' => '密码格式必须是数字字母组合！'
    ];
    public function add($array){
       return (new OperateModel())->addOperate($array);
    }
    public function edit($id,$array){
       return (new OperateModel())->editOperate($id,$array);
    }
}